package com.ruoyi.know.service.impl;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.know.domain.UserFollow;
import com.ruoyi.know.mapper.UserFollowMapper;
import com.ruoyi.know.service.UserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserFollowServiceImpl implements UserFollowService {

    @Autowired
    private UserFollowMapper userFollowMapper;

    @Override
    public int followUser(UserFollow userFollow) {
        return userFollowMapper.followUser(userFollow);
    }

    @Override
    public int unfollowUser(int followerId, int followedId) {
        return userFollowMapper.unfollowUser(followerId, followedId);
    }

    @Override
    public List<SysUser> getFollowedUsers(int followerId,String nickName) {
        return userFollowMapper.getFollowedUsers(followerId,nickName);
    }

    @Override
    public List<SysUser> getNewFollowers(int followedId,String nickName) {
        return userFollowMapper.getNewFollowers(followedId,nickName);
    }

    @Override
    public int getFocused(Long followerId, Long followedId) {
        return userFollowMapper.getFocused(followerId, followedId);
    }


}
